﻿<ClientManagerView:EventResourceDictionary x:Class="FacebookClient.FriendViewerEventResourceDictionary" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ClientManager="clr-namespace:ClientManager" xmlns:ClientManagerControls="clr-namespace:ClientManager.Controls" xmlns:ClientManagerView="clr-namespace:ClientManager.View" xmlns:Facebook="clr-namespace:Contigo;assembly=Contigo" xmlns:Properties="clr-namespace:FacebookClient.Properties" xmlns:FacebookClient="clr-namespace:FacebookClient">

  <FacebookClient:SexPronounConverter x:Key="SexPronounConverter" />
  <FacebookClient:IsStringNullOrWhitespaceConverter x:Key="IsStringNullOrWhitespaceConverter" />
  <FacebookClient:MultiValueAggregator x:Key="MultiAggregator" />
    
  <Style x:Key="FriendViewerInformationalTextBlock" TargetType="{x:Type TextBlock}">
    <Setter Property="Margin" Value="30, 10" />
    <Setter Property="VerticalAlignment" Value="Center" />
    <Setter Property="IsHyphenationEnabled" Value="True" />
    <Setter Property="TextTrimming" Value="WordEllipsis" />
    <Setter Property="TextWrapping" Value="Wrap" />
    <Setter Property="FontFamily" Value="{DynamicResource SansSerifFont}" />
    <Setter Property="FontSize" Value="{DynamicResource LargeFontSize1}" />
    <Setter Property="FontWeight" Value="Light" />
    <Setter Property="Foreground" Value="{DynamicResource FriendViewerInformationalTextBlockForeground}" />
  </Style>

  <TextBlock x:Key="InterestingYetNoPhotosTextBlock" Style="{StaticResource FriendViewerInformationalTextBlock}">
    <Run>Fishbowl is trying to get photo albums by</Run>
    <Run Text="{Binding Path=FacebookContact.Name, Mode=OneWay}" />
    <Run>but so far hasn't found any.  This might take a little while, or maybe</Run>
    <Run Text="{Binding Path=FacebookContact.FirstName, Mode=OneWay}" />
    <Run>has privacy settings such that this application can't see</Run>
    <Run Text="{Binding Path=FacebookContact,  Converter={StaticResource SexPronounConverter}, ConverterParameter=Possessive, Mode=OneWay}" />
    <Run>photos.</Run>
    <LineBreak />
    <Run>You can click on the Facebook button in the toolbar to see</Run>
    <Run Text="{Binding Path=FacebookContact, Converter={StaticResource SexPronounConverter}, ConverterParameter=Possessive, Mode=OneWay}" />
    <Run>real Facebook page in a browser.</Run>
  </TextBlock>

  <TextBlock x:Key="NeutrallyInterestingYetNoPhotosTextBlock" Style="{StaticResource FriendViewerInformationalTextBlock}">
    <Run Text="{Binding Path=FacebookContact.Name, Mode=OneWay}" />
    <Run>either hasn't updated any albums recently or may not allow this application to see them.  If you want to see all the albums posted by</Run>
    <Run Text="{Binding Path=FacebookContact.FirstName, Mode=OneWay}" />
    <Run>try increasing the interest level slider.</Run>
  </TextBlock>

  <TextBlock x:Key="UninterestingTextBlock" Style="{StaticResource FriendViewerInformationalTextBlock}">
    <Run Text="{Binding Path=FacebookContact.Name, Mode=OneWay}" />
    <Run>isn't interesting to you right now.</Run>
    <LineBreak />
    <Run>If you change your mind and want to see information about</Run>
    <Run Text="{Binding Path=FacebookContact.FirstName, Mode=OneWay}" />
    <Run>again just move the "Interest Level" slider to the right.</Run>
  </TextBlock>

  <ControlTemplate x:Key="FriendRadioButtonTemplate" TargetType="{x:Type RadioButton}">
    <Grid Cursor="Hand">

      <Rectangle x:Name="bevel1" Fill="{DynamicResource FriendViewerCategoryTabsBevel1}" Height="1" SnapsToDevicePixels="True" Margin="0,0,0,1" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" />
      <Rectangle x:Name="bevel2" Fill="{DynamicResource FriendViewerCategoryTabsBevel2}" Height="1" SnapsToDevicePixels="True" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" />
      <Rectangle x:Name="selected" Fill="{DynamicResource FriendViewerCategoryTabsSelectedBrush}" Opacity="0" />
      <Rectangle x:Name="hover" Fill="{DynamicResource FriendViewerCategoryTabsHoveredBrush}" Opacity="0" />
      
      <TextBlock x:Name="ContentTextblock" HorizontalAlignment="Left" Margin="26,0,0,0" Foreground="{DynamicResource FriendViewerCategoryTabsUnSelectedTextBrush}" VerticalAlignment="Center" FontFamily="{DynamicResource SansSerifFont}" FontSize="{DynamicResource MiddleFontSize}" FontWeight="Light" Text="{TemplateBinding Content}" />
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="IsChecked" Value="True">
        <Setter TargetName="selected" Property="Opacity" Value="1" />
        <Setter TargetName="ContentTextblock" Property="Foreground" Value="{DynamicResource FriendViewerCategoryTabsSelectedTextBrush}" />
        <Setter TargetName="ContentTextblock" Property="FontWeight" Value="Medium" />
      </Trigger>
      <Trigger Property="Tag" Value="False">
        <Setter TargetName="bevel1" Property="Opacity" Value="0" />
        <Setter TargetName="bevel2" Property="Opacity" Value="0" />
      </Trigger>
      <Trigger Property="IsMouseOver" Value="True">
        <Trigger.EnterActions>
          <BeginStoryboard>
            <Storyboard>
              <DoubleAnimation To=".3" Duration="0:0:0.3" Storyboard.TargetName="hover" Storyboard.TargetProperty="Opacity" />
            </Storyboard>
          </BeginStoryboard>
        </Trigger.EnterActions>
        <Trigger.ExitActions>
          <BeginStoryboard>
            <Storyboard>
              <DoubleAnimation To="0" Duration="0:0:0.4" Storyboard.TargetName="hover" Storyboard.TargetProperty="Opacity" />
            </Storyboard>
          </BeginStoryboard>
        </Trigger.ExitActions>
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>

  <Style x:Key="InterestRepeatButton" TargetType="{x:Type RepeatButton}">
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="IsTabStop" Value="False" />
    <Setter Property="Focusable" Value="False" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type RepeatButton}">
          <Border Background="Transparent" />
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="InterestThumb" TargetType="{x:Type Thumb}">
    <Setter Property="Focusable" Value="False" />
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="Cursor" Value="Hand" />
    <Setter Property="Width" Value="20" />
    <Setter Property="Height" Value="28" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Thumb}">
          <Grid Background="Transparent">
            <Polygon x:Name="up" Fill="{DynamicResource LikeSliderThumbBrushUp}" Points="0,0 13,0 13,11 6.5,22 0,11 0,0" Stroke="White" StrokeThickness="1"  />
            <Polygon x:Name="down" Fill="{DynamicResource LikeSliderThumbBrushDown}" Opacity="0" Points="0,0 13,0 13,11 6.5,22 0,11 0,0" Stroke="White" StrokeThickness="1" />
            <Polygon x:Name="hover" Fill="{DynamicResource LikeSliderThumbBrushHover}" Opacity="0" Points="0,0 13,0 13,11 6.5,22 0,11 0,0" Stroke="White" StrokeThickness="1"  />
          </Grid>

          <ControlTemplate.Triggers>
            <EventTrigger RoutedEvent="Mouse.MouseEnter">
              <EventTrigger.Actions>
                <BeginStoryboard>
                  <Storyboard>
                    <DoubleAnimation To="0" Duration="0:0:0.3" Storyboard.TargetName="up" Storyboard.TargetProperty="Opacity" />
                    <DoubleAnimation To="1" Duration="0:0:0.3" Storyboard.TargetName="hover" Storyboard.TargetProperty="Opacity" />
                    <DoubleAnimation To="0" Duration="0:0:0.3" Storyboard.TargetName="down" Storyboard.TargetProperty="Opacity" />
                  </Storyboard>
                </BeginStoryboard>
              </EventTrigger.Actions>
            </EventTrigger>
            <EventTrigger RoutedEvent="Mouse.MouseLeave">
              <EventTrigger.Actions>
                <BeginStoryboard>
                  <Storyboard>
                    <DoubleAnimation To="1" Duration="0:0:0.4" Storyboard.TargetName="up" Storyboard.TargetProperty="Opacity" />
                    <DoubleAnimation To="0" Duration="0:0:0.4" Storyboard.TargetName="hover" Storyboard.TargetProperty="Opacity" />
                    <DoubleAnimation To="0" Duration="0:0:0.3" Storyboard.TargetName="down" Storyboard.TargetProperty="Opacity" />
                  </Storyboard>
                </BeginStoryboard>
              </EventTrigger.Actions>
            </EventTrigger>
            <EventTrigger RoutedEvent="Mouse.MouseDown">
              <EventTrigger.Actions>
                <BeginStoryboard>
                  <Storyboard>
                    <DoubleAnimation To="0" Duration="0:0:0.3" Storyboard.TargetName="up" Storyboard.TargetProperty="Opacity" />
                    <DoubleAnimation To="0" Duration="0:0:0.3" Storyboard.TargetName="hover" Storyboard.TargetProperty="Opacity" />
                    <DoubleAnimation To="1" Duration="0:0:0.3" Storyboard.TargetName="down" Storyboard.TargetProperty="Opacity" />
                  </Storyboard>
                </BeginStoryboard>
              </EventTrigger.Actions>
            </EventTrigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="InterestSlider" TargetType="{x:Type Slider}">
    <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false" />
    <Setter Property="Focusable" Value="False" />
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="BorderThickness" Value="1" />
    <Setter Property="BorderBrush" Value="#0000" />
    <Setter Property="IsSnapToTickEnabled" Value="True" />
    <Setter Property="RenderTransformOrigin" Value=".5,.5" />
    <Setter Property="MinWidth" Value="50" />
    <Setter Property="MinHeight" Value="0" />
    <Setter Property="Width" Value="150" />
    <Setter Property="Padding" Value="0" />
    <Setter Property="Height" Value="Auto" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Slider}">
          <Border Background="Transparent" Padding="{TemplateBinding Padding}">
            <Grid ClipToBounds="False">
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
              </Grid.ColumnDefinitions>
              <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" MinHeight="{TemplateBinding Slider.MinHeight}" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
              </Grid.RowDefinitions>

              <Canvas Grid.Row="1" VerticalAlignment="Center" Height="4">
                <Rectangle x:Name="PART_SelectionRange" Canvas.Top="1" Fill="{TemplateBinding Foreground}" Height="2.0" Visibility="Hidden" />
              </Canvas>
              <Track Grid.Row="1" Name="PART_Track">
                <Track.DecreaseRepeatButton>
                  <RepeatButton Style="{StaticResource InterestRepeatButton}" Command="Slider.DecreaseLarge" />
                </Track.DecreaseRepeatButton>
                <Track.Thumb>
                  <Thumb Style="{StaticResource InterestThumb}" Margin="5 0 0 0" />
                </Track.Thumb>
                <Track.IncreaseRepeatButton>
                  <RepeatButton Style="{StaticResource InterestRepeatButton}" Command="Slider.IncreaseLarge" />
                </Track.IncreaseRepeatButton>
              </Track>
                <Canvas Grid.Row="2" Background="Transparent" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" Width="150" Height="4" Margin="-20,0,-20,0">
                    <Rectangle Width="150" Height="4" RadiusX="2" RadiusY="2"  Canvas.Top="0" Canvas.Left="0" Fill="{DynamicResource LikeSliderBackground}" RenderTransformOrigin="0,0" />
                    <Ellipse Width="4" Height="4" Fill="{DynamicResource LikeSliderTickBrush}" Canvas.Left="10" Canvas.Top="0"/>
                    <Ellipse Width="4" Height="4" Fill="{DynamicResource LikeSliderTickBrush}" Canvas.Right="10" Canvas.Top="0"/>
                    <Ellipse Width="4" Height="4" Fill="{DynamicResource LikeSliderTickBrush}" Canvas.Left="73" Canvas.Top="0"/>
                </Canvas>
              <TickBar Grid.Row="2" Placement="Bottom" Height="4" Visibility="Visible" />

              <TextBlock Grid.Row="3" FontFamily="{DynamicResource SansSerifFont}" FontSize="{DynamicResource SmallFontSize1}" FontWeight="Light" FontStyle="Italic" Margin="0,5,0,0" Text="Interest Level" Foreground="{DynamicResource InterestLevelTextForeground}" HorizontalAlignment="Center" VerticalAlignment="Bottom" />
            </Grid>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsSelectionRangeEnabled" Value="true">
              <Setter TargetName="PART_SelectionRange" Property="Visibility" Value="Visible" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
              <Setter Property="Opacity" Value=".3" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  
  <Style x:Key="BlockTextBlockStyle" TargetType="Paragraph">
    <Setter Property="FontFamily" Value="{DynamicResource SerifFont}" />
    <Setter Property="FontWeight" Value="Medium" />
    <Setter Property="FontSize" Value="{DynamicResource SmallFontSize1}" />
    <Setter Property="Foreground" Value="Gray" />
  </Style>
  
  <Style x:Key="BlockDetailTextBlockStyle" TargetType="{x:Type FacebookClient:HyperlinkTextContent}">
    <Setter Property="FontFamily" Value="{DynamicResource SerifFont}" />
    <Setter Property="FontWeight" Value="Light" />
    <Setter Property="FontSize" Value="{DynamicResource SmallFontSize1}" />
    <Setter Property="Foreground" Value="{DynamicResource ActivityPostMessageTextBlockForeground}" />
  </Style>
  <Style x:Key="AlbumTitleStyle" TargetType="TextBlock">
    <Setter Property="FontFamily" Value="{DynamicResource SansSerifFont}" />
    <Setter Property="FontSize" Value="{DynamicResource LargeFontSize1}" />
    <Setter Property="FontWeight" Value="Bold" />
    <Setter Property="TextTrimming" Value="CharacterEllipsis" />
    <Setter Property="Foreground" Value="#FF393939" />
  </Style>
  <Style x:Key="AlbumInfoStyle" TargetType="TextBlock">
    <Setter Property="FontFamily" Value="{DynamicResource SansSerifFont}" />
    <Setter Property="FontSize" Value="{DynamicResource SmallFontSize1}" />
    <Setter Property="FontWeight" Value="Light" />
    <Setter Property="Foreground" Value="#FF393939" />
  </Style>

  <!-- Normal FriendViewer Layout Template -->
  <ControlTemplate x:Key="FriendViewerTemplate_Normal" TargetType="{x:Type FacebookClient:FriendViewerControl}">
    <DockPanel x:Name="LayoutRoot" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" Margin="0, 10, 0, 0">

      <FacebookClient:FriendBarControl x:Name="PART_FriendBar" Height="115" DockPanel.Dock="Bottom">
        <!-- Hide the friendbar for the Me contact. -->
        <FacebookClient:FriendBarControl.Style>
          <Style TargetType="{x:Type FacebookClient:FriendBarControl}">
            <Setter Property="Visibility" Value="Visible" />
            <Style.Triggers>
              <DataTrigger Binding="{Binding IsMeContact}" Value="True">
                <Setter Property="Visibility" Value="Collapsed" />
              </DataTrigger>
            </Style.Triggers>
          </Style>
        </FacebookClient:FriendBarControl.Style>
      </FacebookClient:FriendBarControl>

      <DockPanel x:Name="ProfileArea" DockPanel.Dock="Left" Width="200" Background="Transparent">

        <Grid x:Name="CategoryTabs" DockPanel.Dock="Bottom" Height="91" Background="{DynamicResource FriendViewerCategoryTabsBrush}">
          <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
          </Grid.RowDefinitions>
          <Grid.Clip>
            <RectangleGeometry RadiusX="13" RadiusY="13" Rect="-13,0,213,104" />
          </Grid.Clip>

          <RadioButton Grid.Row="0" x:Name="WallRadioButton" Command="FacebookClient:FriendViewerControl.DisplayWallCommand" Template="{StaticResource FriendRadioButtonTemplate}">Wall</RadioButton>
          <RadioButton Grid.Row="1" x:Name="InfoRadioButton" Command="FacebookClient:FriendViewerControl.DisplayInfoCommand" Template="{StaticResource FriendRadioButtonTemplate}">Info</RadioButton>
          <RadioButton Grid.Row="2" x:Name="PhotosRadioButton" Command="FacebookClient:FriendViewerControl.DisplayPhotosCommand" Template="{StaticResource FriendRadioButtonTemplate}" Tag="False">Photos</RadioButton>
        </Grid>

        <Grid DockPanel.Dock="Top" VerticalAlignment="Top">
          <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
          </Grid.RowDefinitions>

          <ClientManagerControls:FacebookImageControl FacebookImage="{Binding FacebookContact.Image}" FacebookImageDimensions="Big">
            <ClientManagerControls:FacebookImageControl.Template>
              <ControlTemplate TargetType="{x:Type ClientManagerControls:FacebookImageControl}">
                <Grid Margin="5" HorizontalAlignment="Center" VerticalAlignment="Top" MaxHeight="400">
                  <ContentControl Template="{DynamicResource StandardPhotoChromeContentControlTemplate}" Padding="8">
                    <Image x:Name="PART_PhotoImage" HorizontalAlignment="Center" VerticalAlignment="Center" Source="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ImageSource}" />
                  </ContentControl>
                </Grid>
              </ControlTemplate>
            </ClientManagerControls:FacebookImageControl.Template>
          </ClientManagerControls:FacebookImageControl>

          <Slider x:Name="InterestSlider" Grid.Row="1" LargeChange=".5" Maximum="1" Minimum="0" TickFrequency=".5" TickPlacement="BottomRight" Value="{Binding FacebookContact.InterestLevel, Mode=TwoWay}" Margin="0,0,0,10">
            <!-- We don't want to show the interest slider for the MeContact. -->
            <Slider.Style>
              <Style TargetType="{x:Type Slider}" BasedOn="{StaticResource InterestSlider}">
                <Setter Property="Visibility" Value="Visible" />
                <Style.Triggers>
                  <DataTrigger Binding="{Binding IsMeContact}" Value="True">
                    <Setter Property="Visibility" Value="Collapsed" />
                  </DataTrigger>
                </Style.Triggers>
              </Style>
            </Slider.Style>
          </Slider>

        </Grid>
      </DockPanel>

      <StackPanel x:Name="HeaderArea" MinHeight="50" Margin="10,6,0,0" VerticalAlignment="Top" DockPanel.Dock="Top">
        <TextBlock IsHyphenationEnabled="True" TextTrimming="WordEllipsis" TextWrapping="Wrap" FontFamily="{DynamicResource SansSerifFont}" FontSize="{DynamicResource LargeFontSize2}" FontWeight="Bold" Foreground="{DynamicResource FriendViewerNameForeground}" Text="{Binding Path=FacebookContact.Name}" />
        <Path Grid.Row="1" Fill="#FFE3E7F0" Stretch="Fill" Stroke="#FFE3E7F0" HorizontalAlignment="Left" Margin="25,10,0,0" Width="15" Data="M22.166642,154.45381 L29.999666,187.66699 40.791059,154.54395" StrokeThickness="3" VerticalAlignment="Top" Height="25" RenderTransformOrigin="0.5,0.5" Grid.Column="1">
          <Path.Style>
            <Style TargetType="Path">
              <Style.Triggers>
                <DataTrigger Binding="{Binding Path=FacebookContact.StatusMessage.Message}" Value="{x:Null}">
                  <Setter Property="Visibility" Value="Collapsed" />
                </DataTrigger>
              </Style.Triggers>
            </Style>
          </Path.Style>
          <Path.RenderTransform>
            <TransformGroup>
              <ScaleTransform />
              <SkewTransform />
              <RotateTransform Angle="130" />
              <TranslateTransform />
            </TransformGroup>
          </Path.RenderTransform>
        </Path>

        <Border HorizontalAlignment="Left" Margin="30,-25,15,15" Background="#FFE3E7F0" CornerRadius="10" Padding="2">
          <Border.Style>
            <Style TargetType="Border">
              <Style.Triggers>
                <DataTrigger Binding="{Binding Path=FacebookContact.StatusMessage.Message}" Value="{x:Null}">
                  <Setter Property="Visibility" Value="Collapsed" />
                </DataTrigger>
              </Style.Triggers>
            </Style>
          </Border.Style>

          <TextBlock IsHyphenationEnabled="True" Padding="8,5" TextTrimming="WordEllipsis" TextWrapping="Wrap" FontSize="{DynamicResource LargeFontSize1}" FontWeight="Light" Foreground="#FF85878A">
            <FacebookClient:HyperlinkTextContent FontFamily="{DynamicResource SerifFont}" Text="{Binding Path=FacebookContact.StatusMessage.Message}" />
          </TextBlock>
        </Border>
        <Rectangle Margin="20,2" Height="1" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" SnapsToDevicePixels="True" Fill="{DynamicResource NewsFeedItemDividerBrush}" />
      </StackPanel>

      <Grid x:Name="ContentArea">
        <Grid x:Name="UninterestingContent">
          <Grid.Style>
            <Style TargetType="Grid">
              <Setter Property="Visibility" Value="Collapsed" />
              <Style.Triggers>
                <MultiDataTrigger>
                  <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding Path=FacebookContact.InterestLevel}" Value="0" />
                  </MultiDataTrigger.Conditions>
                  <Setter Property="Visibility" Value="Visible" />
                </MultiDataTrigger>
                <MultiDataTrigger>
                  <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding Path=FacebookContact.InterestLevel}" Value=".5" />
                    <Condition Binding="{Binding Path=FacebookContact.PhotoAlbums.Count}" Value="0" />
                    <Condition Binding="{Binding Path=PhotosDisplayIndex}" Value="0" />
                  </MultiDataTrigger.Conditions>
                  <Setter Property="Visibility" Value="Visible" />
                </MultiDataTrigger>
                <MultiDataTrigger>
                  <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding Path=FacebookContact.InterestLevel}" Value="1" />
                    <Condition Binding="{Binding Path=FacebookContact.PhotoAlbums.Count}" Value="0" />
                    <Condition Binding="{Binding Path=PhotosDisplayIndex}" Value="0" />
                  </MultiDataTrigger.Conditions>
                  <Setter Property="Visibility" Value="Visible" />
                </MultiDataTrigger>
              </Style.Triggers>
            </Style>
          </Grid.Style>

          <Label x:Name="IndicatorLabel" VerticalAlignment="Center">
            <Label.Style>
              <Style TargetType="Label">
                <Style.Triggers>
                  <DataTrigger Binding="{Binding Path=FacebookContact.InterestLevel}" Value="0">
                    <Setter Property="Content" Value="{StaticResource UninterestingTextBlock}" />
                  </DataTrigger>
                  <DataTrigger Binding="{Binding Path=FacebookContact.InterestLevel}" Value=".5">
                    <Setter Property="Content" Value="{StaticResource NeutrallyInterestingYetNoPhotosTextBlock}" />
                  </DataTrigger>
                  <DataTrigger Binding="{Binding Path=FacebookContact.InterestLevel}" Value="1">
                    <Setter Property="Content" Value="{StaticResource InterestingYetNoPhotosTextBlock}" />
                  </DataTrigger>
                </Style.Triggers>
              </Style>
            </Label.Style>

          </Label>

        </Grid>

        <Grid>
          <Grid.Style>
            <Style TargetType="Grid">
              <Setter Property="Visibility" Value="Visible" />
              <Style.Triggers>
                <DataTrigger Binding="{Binding Path=FacebookContact.InterestLevel}" Value="0">
                  <Setter Property="Visibility" Value="Collapsed" />
                </DataTrigger>
              </Style.Triggers>
            </Style>
          </Grid.Style>

          <!-- Info template -->
          <Border>
            <Border.Style>
              <Style TargetType="Border">
                <Setter Property="Visibility" Value="Collapsed" />
                <Style.Triggers>
                  <DataTrigger Binding="{Binding Path=InfoDisplayIndex}" Value="0">
                    <Setter Property="Visibility" Value="Visible" />
                  </DataTrigger>
                </Style.Triggers>
              </Style>
            </Border.Style>
            <FacebookClient:FriendInfoDescriptionViewer FacebookContact="{Binding FacebookContact}" MaxZoom="240" MinZoom="80" Style="{DynamicResource PhotoFlowViewer}" ZoomIncrement="10" />
          </Border>

          <!-- Photo template -->
          <Border>
            <Border.Style>
              <Style TargetType="Border">
                <Setter Property="Visibility" Value="Collapsed" />
                <Style.Triggers>
                  <DataTrigger Binding="{Binding Path=PhotosDisplayIndex}" Value="0">
                    <Setter Property="Visibility" Value="Visible" />
                  </DataTrigger>
                </Style.Triggers>
              </Style>
            </Border.Style>

            <FacebookClient:GalleryHomeControl ShowSortBar="False" ShowOwnerOverlay="False" Templates="{DynamicResource GalleryHomeTemplateCollection}" DataContext="{Binding FacebookContact.PhotoAlbums}" />
          </Border>

          <!-- Wall template spinner. -->
          <ClientManagerControls:Spinner x:Name="PART_WallScrollViewerSpinner" Foreground="{DynamicResource SpinnerBrush}">
            <ClientManagerControls:Spinner.Style>
              <Style TargetType="{x:Type ClientManagerControls:Spinner}">
                <Setter Property="IsRunning" Value="False" />
                <Setter Property="Visibility" Value="Collapsed" />
                <Style.Triggers>
                  <DataTrigger Binding="{Binding ElementName=PART_WallItemsControl, Path=ItemsSource.Count}" Value="0">
                    <Setter Property="IsRunning" Value="True" />
                  </DataTrigger>
                  <DataTrigger Binding="{Binding WallDisplayIndex}" Value="0">
                    <Setter Property="Visibility" Value="Visible" />
                  </DataTrigger>
                </Style.Triggers>
              </Style>
            </ClientManagerControls:Spinner.Style>
          </ClientManagerControls:Spinner>

          <!-- Wall template -->
          <FacebookClient:ScaleScrollViewer x:Name="PART_WallScrollViewer" IsAnimationEnabled="False" MaxScale="2.5" MinScale="0.4" Scale="{Binding Source={x:Static Properties:Settings.Default}, Path=NewsFeedScale, Mode=TwoWay}" MouseWheelScrollDelta="96" Focusable="True">
            <FacebookClient:ScaleScrollViewer.Style>
              <Style TargetType="{x:Type FacebookClient:ScaleScrollViewer}">
                <Setter Property="FocusVisualStyle" Value="{x:Null}" />
                <Setter Property="Template" Value="{DynamicResource MainScaleScrollViewerTemplate}"/>
                <Setter Property="Visibility" Value="Collapsed" />
                <Style.Triggers>
                  <DataTrigger Binding="{Binding WallDisplayIndex}" Value="0">
                    <Setter Property="Visibility" Value="Visible" />
                  </DataTrigger>
                </Style.Triggers>
              </Style>
            </FacebookClient:ScaleScrollViewer.Style>
            <DockPanel>
              <Border DockPanel.Dock="Top" Padding="5" Margin="20,10,20,0" CornerRadius="6" Background="Transparent" HorizontalAlignment="Stretch">
                <Border.Style>
                  <!-- Don't show the Wall box on the Me contact.  
                       We shouldn't let you write on your own wall separate from updating your status.  -->
                  <Style TargetType="{x:Type Border}">
                    <Setter Property="Visibility" Value="Visible" />
                    <Style.Triggers>
                      <DataTrigger Binding="{Binding IsMeContact}" Value="True">
                        <Setter Property="Visibility" Value="Collapsed" />
                      </DataTrigger>
                    </Style.Triggers>
                  </Style>
                </Border.Style>
                <DockPanel VerticalAlignment="Center" HorizontalAlignment="Left" Margin="7,5,0,7">
                  <Button 
                    Style="{DynamicResource StandardButtonStyle}"
                    IsEnabled="{Binding ElementName=PART_WriteOnWallTextBox, Path=Text, Converter={StaticResource IsStringNullOrWhitespaceConverter}, ConverterParameter=Inverse}" 
                    Content="Share" 
                    DockPanel.Dock="Right"
                    Height="22" 
                    Command="{x:Static FacebookClient:CommandTextBox.DoCommitCommand}" 
                    CommandTarget="{Binding ElementName=PART_WriteOnWallTextBox}" 
                    FontSize="{DynamicResource MiddleFontSize}" Margin="10,4,5,0"/>

                  <FacebookClient:CommandTextBox x:Name="PART_WriteOnWallTextBox" BannerText="{Binding Path=FacebookContact.FirstName, StringFormat=Write on \{0\}\'s wall}" Panel.ZIndex="1" Style="{DynamicResource CommentTextBoxStyle}" Margin="0" MaxWidth="300" FontSize="{DynamicResource MiddleFontSize}" TextWrapping="Wrap" SpellCheck.IsEnabled="True" CommitCommand="{Binding Source={x:Static ClientManager:ServiceProvider.ViewManager}, Path=ActionCommands.WriteOnWallCommand}">
                    <FacebookClient:CommandTextBox.CommitCommandParameter>
                      <MultiBinding Converter="{StaticResource MultiAggregator}">
                        <Binding Path="FacebookContact" />
                        <Binding ElementName="PART_WriteOnWallTextBox" Path="Text" />
                      </MultiBinding>
                    </FacebookClient:CommandTextBox.CommitCommandParameter>
                  </FacebookClient:CommandTextBox>

                </DockPanel>
              </Border>
              <FacebookClient:IncrementalLoadListBox x:Name="PART_WallItemsControl" 
                  Margin="0,20,20,10" 
                  ScrollViewer.VerticalScrollBarVisibility="Disabled" 
                  ScrollViewer.HorizontalScrollBarVisibility="Disabled" 
                  BorderThickness="0" 
                  ActualItemsSource="{Binding FacebookContact.RecentActivity}" 
                  Background="Transparent" 
                  ItemTemplate="{DynamicResource NewsFeedItemTemplate}" 
                  HorizontalAlignment="Left">
                <ListBox.ItemContainerStyle>
                  <Style TargetType="ListBoxItem">
                    <Setter Property="FocusVisualStyle" Value="{x:Null}" />
                    <Setter Property="Template">
                      <Setter.Value>
                        <ControlTemplate TargetType="ListBoxItem">
                          <ContentPresenter />
                        </ControlTemplate>
                      </Setter.Value>
                    </Setter>
                  </Style>
                </ListBox.ItemContainerStyle>
              </FacebookClient:IncrementalLoadListBox>
            </DockPanel>
          </FacebookClient:ScaleScrollViewer>
        </Grid>
      </Grid>
    </DockPanel>
    <ControlTemplate.Triggers>
      <Trigger Property="WallDisplayIndex" Value="0">
        <Setter TargetName="WallRadioButton" Property="IsChecked" Value="True" />
      </Trigger>
      <Trigger Property="InfoDisplayIndex" Value="0">
        <Setter TargetName="InfoRadioButton" Property="IsChecked" Value="True" />
      </Trigger>
      <Trigger Property="PhotosDisplayIndex" Value="0">
        <Setter TargetName="PhotosRadioButton" Property="IsChecked" Value="True" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>

  <!-- Collection of templates to use for the photo album control, depending on the amount of space available -->
  <ClientManagerControls:SizeControlTemplateCollection x:Key="FriendViewerTemplateCollection">
    <ClientManagerControls:SizeControlTemplate MinHeight="0" MinWidth="0" Template="{StaticResource FriendViewerTemplate_Normal}" />
  </ClientManagerControls:SizeControlTemplateCollection>

  <!--Control template for the friend viewer control-->
  <Style TargetType="{x:Type FacebookClient:FriendViewerControl}">
    <Setter Property="KeyboardNavigation.IsTabStop" Value="False" />
    <Setter Property="FocusVisualStyle" Value="{x:Null}" />
    <Setter Property="Templates" Value="{StaticResource FriendViewerTemplateCollection}" />
  </Style>
</ClientManagerView:EventResourceDictionary>
